ReactiveUI 🚀 您所在的位置:网站首页 xna perfect in winforms ReactiveUI 🚀

ReactiveUI 🚀

2023-04-16 07:48| 来源: 网络整理| 查看: 265

Ah. Perhaps a bit too quick to post. I read this report as a "my app isn't working" and just pointed out the quickest route to fix it.

Please note that my experience with ReactiveUI so far is very close to zero so take the speculations below for what they are.. Speculations :)

The root of the problem is that WhenActivated depends on external state (via activationFetcherCache) and throws an exception if that isn't initialized, unfortunately I'm not familiar enough with ReactiveUI to determine if this is the only (and best) way to do it.

I think this would work if it would fail silently instead but doesn't feel like a perfect solution to me. Perhaps it would be possible to have a IVewForWinforms that implements a different IActivatable (IActivatableWinforms) and thereby binds to another implementation of Activate that can fail silently? This would still have the drawback of possible silent failures, but would at least limit them to WinForms..

So it certainly looks possible to work out on ReactiveUI side as far as I can see but question is if this narrow case that most WinForms devs will already have some mechanism to guard against (static IsRunning, using bool designMode = LicenseManager.UsageMode == LicenseUsageMode.Designtime and similar) is worth the work?

The obvious limitation of not fixing as I see it is that WhenActivated won't be very usable for someone that distributes CustomControls, but to be honest, who does that these days except for established firms like DevExpress et. al. who still are very unlikely to depend on external (non standard MS) stuff. For me, when I write WinForms code and notice the designer breaking I put a if(IsRunning) on reflex. Perhaps this isn't the best way but it works and I have seen plenty of controls doing the same..



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有